﻿using UnityEngine;

namespace JQMergeFramework
{
    
    public class MainCityUnit: MonoBehaviour
    {

        public MeshFilter mMeshFilter;
        public MeshRenderer mMeshRenderer;
        
        //房子索引
        public int mIndex;
        public void SetMesh(int idx,Mesh mesh,Vector3 pos)
        {
            
            mIndex = idx;
            this.transform.position = pos;
            mMeshFilter.mesh = mesh;
       
            this.transform.localScale = Vector3.one;
            this.gameObject.name = idx.ToString();
        }

        public void SetShow(bool isShow)
        {
            this.gameObject.SetActive(isShow);
        }

        //播放烟雾落地特效
        public void PlaySmoke()
        {
            GameObject eftObj = EffectPool.I.GetPoolObject(PoolName.BuildTheHouse);
            eftObj.transform.position = this.transform.position;
            EffectPool.I.PutPoolObject(PoolName.BuildTheHouse,eftObj,0.7F);
        }
        
    }
    
}